package priv.wjh.concurrent.knowledge.interrupt;

/**
 * //TODO
 *
 * @author wangjunhao
 **/
public class InterruptTest {

    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(() -> {
            long start = System.currentTimeMillis();
            while (true){
                try {

                    Thread.sleep(10000);
                    System.out.println("11111111");
                } catch (InterruptedException e) {
                    System.out.println(System.currentTimeMillis() - start);
                    e.printStackTrace();
                }
            }

        });

        thread.start();
        thread.interrupt();
        System.out.println(thread.isInterrupted());
        thread.join();
    }
}
